<?php
defined('_JEXEC') or die('Restricted access'); 
?>
<form action="index.php?option=com_debate" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
		<thead>
			<tr>
				<th width="5">
					<?php echo JText::_( 'Check' ); ?>
				</th>
				<th>
					<?php echo JText::_( 'Debate ID' ); ?>
				</th>
				<th>
					<?php echo JText::_( 'Debate Name' ); ?>
				</th>
			</tr>            
		</thead>

		<?php
		$k = 0;
		foreach ($this->items as $key => &$row)
		{	$k++;
			//$checked    = JHTML::_( 'grid.id', 1, $row->id );
			
			if( !in_array( $row->id,  $this->getRejected()  ) )  :
			$check='';
			if( $this->getApprove() and in_array($row->id, $this->getApprove()) ) $check ="checked='checked'"; 
			$checked    = '<input type="checkbox" id="cb'.$k.'" name="cid[]" value="'.$row->id.'" onclick="Joomla.isChecked(this.checked);" title="Checkbox for row '.$k.'" '.$check.'/>';
			?>
			<tr class="<?php echo "row" . $key; ?>">
				<td>
					<?php echo $checked; ?>
				</td>
				<td>
					<?php echo $row->id; ?>
				</td>
				<td>
					<?php echo $row->title; ?>
				</td>
			</tr>
			<?php
			endif;
		}
		?>
    </table>
</div>
 
<input type="hidden" name="option" value="com_debate" />
<input type="hidden" name="user_id" value="<?php echo $_GET['user_id'];?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="view" value="<?php echo $_GET['view'];?>" />
 
</form>
